
package com.caration.shell.settings;

import android.bluetooth.BluetoothAdapter;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.media.AudioManager;
import android.net.wifi.WifiManager;

public class SettingBroadcastReceiver extends BroadcastReceiver {

    public SettingBroadcastReceiver() {
        WifiStateManager.getInstance();
        BluetoothManager.getInstance();
        RingerModeManager.getInstance();
    }

    public void onReceive(Context context, Intent intent) {
        String action = intent.getAction();
        if (action.equals(WifiManager.WIFI_STATE_CHANGED_ACTION)) {
            WifiStateManager.getInstance().update();
        } else if (action.equals(BluetoothAdapter.ACTION_STATE_CHANGED)) {
            int i = intent.getIntExtra(BluetoothAdapter.EXTRA_STATE, 0x80000000);
            BluetoothManager.getInstance().update(i);
        } else if (action.equals(Intent.ACTION_AIRPLANE_MODE_CHANGED)) {
            AirplaneModeManager.getInstance().update();
        } else if (action.equals(AudioManager.RINGER_MODE_CHANGED_ACTION)) {
            RingerModeManager.getInstance().update();
        }
    }

}
